<!--业务参数查询-->
<template>
  <div class="app-container">
    <ht-search-form
      v-show="showSearch"
      :dictMap="dictMap"
      :labelWidth="100"
      :queryParams="queryParams"
      :outputQueryParams="queryParams"
      :formOptions="formOptions"
      :advOptions="[]"
      :defaultEventKey="defaultEventKey"
    ></ht-search-form>
    <ht-table
      ref="dataTable"
      rowKey="sysFlg,orgNo,paraCode"
      :showSerialNumber="false"
      :multi-select="false"
      :dictMap="dictMap"
      :reqConfig="reqConfig"
      :queryParams="queryParams"
      :tableBindColumns="tableBindColumns"
      :opButtonList="opButtonList"
    >
      <template v-slot:operate>
        <el-table-column label="操作" align="left" width="200px" fixed="right" class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <ht-button-group
              :buttonList="[
                {
                  label: '修改',
                  doFunc: () => {
                    edit(scope.row);
                  },
                },
                {
                  label: '删除',
                  doFunc: () => {
                    del(scope.row);
                  },
                },
              ]"
            />
          </template>
        </el-table-column>
      </template>
    </ht-table>
    <CustLimitManageEditDialog ref="custLimitManageEditDialog" @editComplete="editComplete"></CustLimitManageEditDialog>

  </div>
</template>
<script>
import { custLimitManageSearchUrlConfig, custLimitDelete} from "@/api/cnaps/bizMng/custLimitManage.js";
import { listPageMixin } from "@/libs/listPageMixin";
import CustLimitManageEditDialog from "./editDialog";
export default {
  name: "custLimitManage",
  mixins: [listPageMixin],
  components: {
    CustLimitManageEditDialog
  },
  props: {},
  data() {
    return {
      reqConfig: custLimitManageSearchUrlConfig,
      defaultEventKey: "",
      //数据字典
      searchFormDictList: [],
      // 遮罩层
      loading: true,
      // 弹出层标题
      title: "",
      showSearch: true,
      // 日期范围
      dateRange: [],
      // 查询参数
      queryParams: {
        paraCode:"",
        paraName:"",
        sysFlg:""
      },
      formOptions: [],
      opButtonList: () => {
        return [];
      },
      tableBindColumns: [
        { label: `分行号`, prop: "brno", align: "center" },
        { label: `账户号`, prop: "acctNo", align: "center" },
        { label: `账户中文名`, prop: "acctName", align: "center" },
        { label: `账户英文名`, prop: "acctEnName", align: "center" },
        { label: `付款日超限金额`, prop: "payDateOverAmount", align: "center" },
        { label: `付款日超限笔数`, prop: "payDateOverNum", align: "center" }
      ],
    };
  },
  mounted() {
    this.formOptions = [
      {
        type: "input",
        prop: "acctNo",
        defaultAttr: {
          label: "账户号",
          placeholder: "请输入账户号",
        },
      },
      {
        type: "input",
        prop: "acctName",
        defaultAttr: {
          label: "账户中文名",
          placeholder: "请输入账户中文名",
        },
      }
    ];
  },
  methods: {
    /** todo 查询当天操作员的交易记录 */
    getList() {
      this.doQuery();
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    detail(row) {
      console.log("this.$refs.bizParaQueryDialog", this.$refs.bizParaQueryDialog);
      this.$refs.bizParaQueryDialog.show(row);
    },
    editComplete(state) {
      console.log("editComplete", state);
      if (state == true) {
        this.getList();
      }
    },
    edit(row) {
      this.$refs.custLimitManageEditDialog.show(row);
    },
    del(row) {
      this.$confirm("确认删除该条客户限额信息?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(function () {
          return custLimitDelete(row);
        })
        .then(() => {
          this.handleQuery();
          this.msgSuccess("删除成功");
        })
        .catch((action) => {});
    },
  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}
</style>
